//
//  NoteView.m
//  Reader
//
//  Created by Alex Di Mango on 03/07/12.
//  Copyright (c) 2012 Whardoo.com - All rights reserved.
//

#import "NoteView.h"
@implementation NoteView 
@synthesize testo,lines;


-(void)drawRect:(CGRect)rect
{
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetRGBStrokeColor(context, 255.0, 0.0, 0.0, 1.0);
	CGContextSetLineWidth(context, 2.5);
    
       for (NSMutableArray *linePoints in lines) {
           int index =0;
            for(NSValue *val in linePoints){
                if(index==0){
                    CGPoint p0 = [val CGPointValue];
                    CGContextMoveToPoint(context,p0.x,p0.y); 
                    index = 1;
                } else {
                CGPoint p = [val CGPointValue];        
                CGContextAddLineToPoint(context,p.x,p.y);
                }
            }
            CGContextStrokePath(context);
        }
}

-(void)dealloc {
    [lines release];
    [testo release];
    [super dealloc];
}
@end
